In a grid-connected photovoltaic generation system, the frequency of phasor is an important observation. The automatic safety device of the grid-connected photovoltaic generation system needs to measure the value of the frequency of phasor in real time, and takes corresponding control measures according to the change of the value. For the automatic safety device of the generation system, the common frequency measurement methods include hardware zero-crossing detection method and a method of calculating a phase upon discrete Fourier transform and further calculating the frequency. Both the two methods have some disadvantages. In the hardware zero-crossing detection method, the precision is likely to be interfered by the slight fluctuation of the reference level of a power supply; however, as lots of power electronic apparatuses are used in the grid-connected photovoltaic generation system, lots of noise and harmonic waves will be generated, as a result, the hardware zero-crossing detection cannot be implemented correctly. In the method of calculating a phase upon discrete Fourier transform and further calculating the frequency, the key point is that the phase must be calculated accurately. If the phase is calculated inaccurately, the accuracy of calculation of the frequency will be influenced.
As shown in FIG. 3, in a conventional method for calculating a phase by discrete Fourier transform, it is required to divide singles connected by a sampling module into a plurality of data windows, and the frequency, magnitude and other related parameters of signals in different data windows are assumed to be constant. Therefore, the conventional method for calculating a phase by discrete Fourier transform is to transform signals in two different data windows and further output results. However, as the grid-connected photovoltaic generation system is a dynamically nonlinear system, the frequency and amplitude of signals in the data windows change from moment to moment in the generation system. In this case, the accuracy of measurement by the conventional method for calculating a phase upon discrete Fourier transform will decline. As a result, the output frequency and phasor of an inventor in the grid-connected photovoltaic generation system are asynchronous with the actual frequency and phasor of the generation system, or even unexpected oscillation will occur in the grid-connected photovoltaic generation system.